Skip to content

feat(fe): impl kakao login#3628

Open
dayeoni wants to merge 24 commits into
feat/remove-whitelistfrom
t2754-impl-kakao-login-v2
Open

feat(fe): impl kakao login#3628
dayeoni wants to merge 24 commits into
feat/remove-whitelistfrom
t2754-impl-kakao-login-v2

Conversation

@dayeoni

@dayeoni dayeoni commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Description

카카오 로그인 연동

케이스별로 다른 모달이 뜹니다.
최초 가입자 / 기존 가입자, 소셜 로그인을 먼저 시도했을 때 아직 연동되지 않은 경우 등을
분기 처리하여 각 상황에 맞는 화면으로 이동하도록 작업합니다.

Additional context

개요

카카오 소셜 로그인 도입에 따른 프론트엔드 작업입니다. 백엔드 PR(#3627, t2752-redirect-to-frontend-after-kakao-oauth)의 redirect 변경에 맞춰, 로그인 시나리오를 4가지로 나눠 처리했습니다.

구현된 케이스

케이스 1 — 기존 가입자, 카카오로 로그인

  • 백엔드가 /로 redirect (쿼리 파라미터 없음)
  • 이 redirect 과정에서 accessToken(헤더)은 날아가고 refresh_token만 쿠키로 남기 때문에, SocialLoginHandler.tsx가 홈 진입 시 자동으로 GET /auth/reissueGET /user 호출해서 토큰/유저 정보를 받아오고, NextAuth social provider(authorizeSocial.ts, authOptions.ts)로 세션을 생성합니다.
  • 검증: 실제 카카오 계정을 로컬 DB의 테스트 유저에 연동한 뒤, 카카오 로그인 → /로 자동 리다이렉트 + 세션 생성까지 확인함

케이스 2 — 미가입자, 카카오로 로그인 (신규가입 유도)

  • 백엔드가 /login?modal=social-unlinked&oauthToken=xxx로 redirect
  • LogInPage.tsxoauthToken을 쿼리에서 읽어 `stores/socialAuth.ts'에 저장
  • "회원가입 이어서하기" 클릭 시 /signup으로 이동, store는 유지됨
최초 로그인- 소셜 로그인

케이스 3 — 카카오 로그인 시도했지만 기존 계정 존재 (모달에서 "로그인" 선택)

  • 케이스 2와 같은 모달에서 "로그인" 클릭 → /login으로 이동(oauthToken은 store에 유지)
  • 일반 로그인 성공 시, store에 oauthToken이 남아있으면 자동으로 POST /auth/social-link를 호출해서 카카오 계정을 연동
  • 연동 실패해도 로그인 흐름은 막지 않음 (실패 시 콘솔 로그만)
  • 검증: Bruno로 /auth/social-link 정상 연동(200), 중복 연동 시도(409), 인증 없이 요청(401) 케이스 확인함

케이스 4 — 일반 로그인 후 소셜 로그인 프로모션 모달

  • 일반(아이디/비밀번호) 로그인 성공 시, 방금 소셜 연동을 안 했다면 "소셜 로그인이 도입되었어요!" 모달 표시
  • "나중에 하기" → 홈 이동 / "로그인하러 가기" → /settings 이동
  • "오늘 하루 동안 안보기" 체크 시 localStorage 기반으로 당일 재노출 방지 (libs/auth/socialLoginPromoDismissal.ts)
기존 로그인

추가

Figma에는 없지만, 깃허브+구글+네이버 로그인 시도 시 '준비 중인 기능입니다'를 띄워 작동하지 않도록 막았습니다.
준비중인 기능(깃헙, 네이버, 구글)


Before submitting the PR, please make sure you do the following

closes TAS-2754

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces social login integration (primarily Kakao) and refactors the login and signup flows, including the addition of a SocialLoginHandler to manage NextAuth sessions, a new LogInLayout, and an InfoModal for unlinked social accounts. The code review feedback suggests several improvements: wrapping the login page in a <Suspense> boundary to prevent CSR de-optimization from useSearchParams(), removing unused commented-out code and an unused store selector, using the centralized baseUrl constant instead of raw environment variables, and properly handling unimplemented social login buttons to prevent user confusion.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread apps/frontend/app/(client)/login/page.tsx Outdated
Comment thread apps/frontend/app/(client)/login/page.tsx
Comment thread apps/frontend/components/auth/RecoverAccount/FindUserId.tsx Outdated
Comment thread apps/frontend/components/auth/RecoverAccount/RecoverAccount.tsx Outdated
Comment thread apps/frontend/components/auth/LogInPage/LogInPage.tsx
Comment thread apps/frontend/components/auth/LogInPage/LogInPage.tsx
@dayeoni dayeoni added the preview 이 라벨이 붙어있어야 프론트엔드 Preview 환경이 생성됩니다 label Jul 16, 2026
@skkuding-bot

skkuding-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

Syncing Preview App Failed

Application: frontend
Revision: 27573902a73b550d5c589e6f2109c25d5eb37832
Health Status: Degraded

Open Preview | View in Argo CD

@skkuding-bot

skkuding-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

Syncing Preview App Succeeded

Application: frontend
Revision: f7b2a87e6d22c0a57218e541b875e2da62e84f2b
Health Status: Healthy

Open Preview | View in Argo CD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview 이 라벨이 붙어있어야 프론트엔드 Preview 환경이 생성됩니다 🌊 squad-__init__ ⛳️ team-frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant